import {$http} from "@/utils/request/requestConfig.js"

const api = {
	'recommendation':"api/common/route/recommendation",	
	"upload":"api/common/upload",
	'explain':"api/evaluation/img/info",
	
}

/**
 * 首页推荐
 */
export const recommend = () => {
	return $http.get(api.recommendation)
}


// 图片上传
export const upload = files => {
  // 文件上传大小, 2M
  const maxSize = 1024 * 1024 * 2
  // 执行上传
  return new Promise((resolve, reject) => {
    $http.urlFileUpload({ files, maxSize })
      .then(result => {
		  
		resolve(result[0])
	  })
      .catch(reject)
  })
}

/**
 * 图片解释
 */
export const imageExplain = (data) => {
	return $http.get(api.explain,data)
}